<?php

namespace App\Listeners\ActivityCommon;

use App\Events\ActivityCommonCreated;
//use Illuminate\Queue\InteractsWithQueue;
//use Illuminate\Contracts\Queue\ShouldQueue;
use App\Morefun\ActivityCommon\RedisSynchronizer as ShakingRedisSynchronizer;

class WriteActivityToRedis
{
    protected $synchronizer;

    /**
     * @param ShakingRedisSynchronizer $synchronizer
     * Create the event listener.
     */
    public function __construct(ShakingRedisSynchronizer $synchronizer)
    {
        $this->synchronizer = $synchronizer;
    }

    /**
     * Handle the event.
     *
     * @param  ActivityCommonCreated  $event
     * @return void
     */
    public function handle(ActivityCommonCreated $event)
    {
        $this->synchronizer->write($event->activity);
    }
}
